package pers.lx.crm.base.util;

import pers.lx.crm.base.common.pigeon.Result;
import pers.lx.crm.base.constant.KeyConstants;
import pers.lx.crm.entiy.BaseDO;

/**
 * Created by lxl on 2017/2/15.
 */
public final class ResultUtil {

    public final static Result getPageResult(BaseDO base,Result result){
        if( base == null || base.getList() == null){
            return result ;
        }
        if( result == null ){
            result = new Result() ;
        }
        result.addParam(KeyConstants.PAGE_NUM,base.getPageNum());
        result.addParam(KeyConstants.PAGE_SIZE,base.getPageSize());
        result.addParam(KeyConstants.TOTAL,base.getTotal());
        result.addParam(KeyConstants.LIST_KEY,base.getList());
        return result ;
    }

}
